package com.example.ffepeg.ffmTestIng;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;

public class Time {
    public static void main(String[] args) {
        // 给定的时间戳
        String time = "1745375009934";
        long timestamp = Long.parseLong(time);
        // 使用Instant将时间戳转换为人类可读的格式
        Instant instant = Instant.ofEpochMilli(timestamp);

        // 将Instant转换为特定时区的LocalDateTime
        LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, ZoneId.systemDefault());

        // 定义日期时间格式
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");

        // 格式化并打印结果
        String formattedDateTime = localDateTime.format(formatter);
        System.out.println("Formatted Date Time: " + formattedDateTime);
    }
}
